package com.fp.helig.Res;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;
 
public class Textures {
 
    private TiledTextureRegion element;
 
    public Textures(final BaseGameActivity activity, final Engine engine, int SizeX, int SizeY,String Name, int dx, int dy) {
        BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
        BitmapTextureAtlas mTexture = new BitmapTextureAtlas(SizeX, SizeY, TextureOptions.NEAREST_PREMULTIPLYALPHA);
        this.element = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(mTexture, activity, Name, 0, 0,dx,dy);
        engine.getTextureManager().loadTexture(mTexture);
    }
 
    public TiledTextureRegion getElement() {
        return element;
    }
}